package com.besttone.search.util;

import com.besttone.search.model.RequestInfo;

public class XmlHelper {
	public static String getRequestXml(RequestInfo info) {
		StringBuilder sb = new StringBuilder("");
		if(info!=null) {
			sb.append("<RequestInfo>");
			sb.append("<region><![CDATA["+info.getRegion()+"]]></region>");
			sb.append("<deviceid><![CDATA["+info.getDeviceid()+"]]></deviceid>");
			sb.append("<imsi><![CDATA["+info.getImsi()+"]]></imsi>");
			sb.append("<content><![CDATA["+info.getContent()+"]]></content>");
			if(info.getPage()!=null){
				sb.append("<Page><![CDATA["+info.getPage()+"]]></Page>");
			}
			if(info.getPageSize()!=null){
				sb.append("<PageSize><![CDATA["+info.getPageSize()+"]]></PageSize>");
			}
			if(info.getMobile()!=null){
				sb.append("<mobile><![CDATA["+info.getMobile()+"]]></mobile>");
			}
			if(info.getMobguishu()!=null){
				sb.append("<mobguishu><![CDATA["+info.getMobguishu()+"]]></mobguishu>");
			}
			sb.append("</RequestInfo>");
		}

		return sb.toString();
	}
}
